package com.yiren.backstage.currency.entity;
import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import com.yiren.backstage.db.dao.DaoSession;
import com.yiren.backstage.db.dao.GradeStandardEntityDao;
import com.yiren.backstage.db.dao.JudgeDetailsEntityDao;
import com.yiren.backstage.db.dao.JudgeResultEntityDao;

/**
 * Time:2021/10/29 9:41
 * Author:xiaozan
 * Description: 评判详情结果 实体类
 */
@Entity(nameInDb = "judge_result", createInDb = false)
public class JudgeResultEntity {
    @Id
    private String id;

    /**所属评判详情*/
    private String judgeDetailsId;
    @ToOne(joinProperty = "judgeDetailsId")
    private JudgeDetailsEntity judgeDetailsEntity;

    /**扣分标准*/
    private String gradeStandardId;
    @ToOne(joinProperty = "gradeStandardId")
    private GradeStandardEntity gradeStandardEntity;

    /** 触发结果  对应 ResultStateEnum*/
    private String			resultType;

    /**是否执行扣分*/
    private String				executeGrade;

    /**是否继续执行*/
    private String				continueExecute;

    /**是否终结当前项目*/
    private String				overProject;

    /**是否结束考试*/
    private String				endExam;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 837449617)
    private transient JudgeResultEntityDao myDao;

    @Generated(hash = 874400924)
    public JudgeResultEntity(String id, String judgeDetailsId,
            String gradeStandardId, String resultType, String executeGrade,
            String continueExecute, String overProject, String endExam) {
        this.id = id;
        this.judgeDetailsId = judgeDetailsId;
        this.gradeStandardId = gradeStandardId;
        this.resultType = resultType;
        this.executeGrade = executeGrade;
        this.continueExecute = continueExecute;
        this.overProject = overProject;
        this.endExam = endExam;
    }

    @Generated(hash = 686196153)
    public JudgeResultEntity() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJudgeDetailsId() {
        return this.judgeDetailsId;
    }

    public void setJudgeDetailsId(String judgeDetailsId) {
        this.judgeDetailsId = judgeDetailsId;
    }

    public String getGradeStandardId() {
        return this.gradeStandardId;
    }

    public void setGradeStandardId(String gradeStandardId) {
        this.gradeStandardId = gradeStandardId;
    }

    public String getResultType() {
        return this.resultType;
    }

    public void setResultType(String resultType) {
        this.resultType = resultType;
    }

    public String getExecuteGrade() {
        return this.executeGrade;
    }

    public void setExecuteGrade(String executeGrade) {
        this.executeGrade = executeGrade;
    }

    public String getContinueExecute() {
        return this.continueExecute;
    }

    public void setContinueExecute(String continueExecute) {
        this.continueExecute = continueExecute;
    }

    public String getOverProject() {
        return this.overProject;
    }

    public void setOverProject(String overProject) {
        this.overProject = overProject;
    }

    public String getEndExam() {
        return this.endExam;
    }

    public void setEndExam(String endExam) {
        this.endExam = endExam;
    }

    @Generated(hash = 1493704430)
    private transient String judgeDetailsEntity__resolvedKey;

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1350978260)
    public JudgeDetailsEntity getJudgeDetailsEntity() {
        String __key = this.judgeDetailsId;
        if (judgeDetailsEntity__resolvedKey == null
                || judgeDetailsEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            JudgeDetailsEntityDao targetDao = daoSession.getJudgeDetailsEntityDao();
            JudgeDetailsEntity judgeDetailsEntityNew = targetDao.load(__key);
            synchronized (this) {
                judgeDetailsEntity = judgeDetailsEntityNew;
                judgeDetailsEntity__resolvedKey = __key;
            }
        }
        return judgeDetailsEntity;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1160593419)
    public void setJudgeDetailsEntity(JudgeDetailsEntity judgeDetailsEntity) {
        synchronized (this) {
            this.judgeDetailsEntity = judgeDetailsEntity;
            judgeDetailsId = judgeDetailsEntity == null ? null
                    : judgeDetailsEntity.getId();
            judgeDetailsEntity__resolvedKey = judgeDetailsId;
        }
    }

    @Generated(hash = 107543780)
    private transient String gradeStandardEntity__resolvedKey;

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1389097317)
    public GradeStandardEntity getGradeStandardEntity() {
        String __key = this.gradeStandardId;
        if (gradeStandardEntity__resolvedKey == null
                || gradeStandardEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            GradeStandardEntityDao targetDao = daoSession
                    .getGradeStandardEntityDao();
            GradeStandardEntity gradeStandardEntityNew = targetDao.load(__key);
            synchronized (this) {
                gradeStandardEntity = gradeStandardEntityNew;
                gradeStandardEntity__resolvedKey = __key;
            }
        }
        return gradeStandardEntity;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 695994375)
    public void setGradeStandardEntity(GradeStandardEntity gradeStandardEntity) {
        synchronized (this) {
            this.gradeStandardEntity = gradeStandardEntity;
            gradeStandardId = gradeStandardEntity == null ? null
                    : gradeStandardEntity.getId();
            gradeStandardEntity__resolvedKey = gradeStandardId;
        }
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1003754792)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getJudgeResultEntityDao() : null;
    }


}
